function addGate() {
    $(".alert").text("");
    $.ajax({
            type: "post",
            url: "http://iot.wduozhi.xyz/api/gateway",
            data: $('#addForm2').serialize(),
            dataType: "json",
            success: function (data) {
                console.log(data);
                if (data.status === "success") {
                    alert("添加网关成功");
                    $("#addGate").click();      //关闭窗口
                    $("#addForm2")[0].reset(); //清空表单
                    window.location.reload();
                } else {
                    showMsg("添加失败");
                }
            },
            error: function () {
                console.log("error!");
                showMsg("500：添加失败")
            }
        }
    )
}